//1.引入fs模块
const fs = require('fs');

//2.使用Promise 封装
const p = new  Promise(function(resolve, reject) {
   fs.readFile('13.weixue.md', (err, data) => {
        //出现错误
        if(err) reject(err);
        //成功读取到数据
        resolve(data);
    })
})

//3.调用then方法
p.then(function(value){
    console.log(value.toString());
},function(reason){
    console.log('读取失败!');
})